{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Intro notebook\n",
    "\n",
    "Some important links to keep open during the workshop – open these tabs **now**!:\n",
    "\n",
    "- [TF documentation](https://www.tensorflow.org/versions/master/api_guides/python/array_ops) : Use the search box (top right) to get documentation on Tensorflow's rich API\n",
    "\n",
    "- [solutions/](../solutions) : Every notebook in the `exercises/` directory has a corresponding notebook in the `solutions/` directory."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'1.4.1'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "from matplotlib import pyplot\n",
    "%matplotlib inline\n",
    "# Always make sure you are using running the expected version.\n",
    "# There are considerable differences between versions...\n",
    "# Make sure your version is \"1.4.X\"\n",
    "tf.__version__"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Important shortcuts – **give it a try!**\n",
    "\n",
    "- `<ESC>` : goes from edit to \"command\" mode\n",
    "- `<ENTER>` : goes from \"command\" to edit mode\n",
    "- `<CTRL-ENTER>` : executes current cell\n",
    "- `<SHIFT-ENTER>` : executes current cell and moves to next cell\n",
    "- `<h>` : shows help (works only in \"command\" mode)\n",
    "- `<CTRL-SHIFT-P>` (mac: `<COMMAND-SHIFT-P>`) : shows searchable command palette\n",
    "- `<m>` : change cell from \"code\" to \"markdown\" (works only in \"command\" mode)\n",
    "- `<y>` : change cell from \"markdown\" to \"code\" (works only in \"command\" mode)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x7fcddaf97c90>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB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9sXAPhp0eV2cNxvAvB6AA+1ef4aAN8AQABvBPC9LMpRlRbAxQAOmtkhM3sOwJ0A1rdssx7AHcHtuwFcTpI5ljELkcdtZveY2fHg7v0AluVcxizE+bwB4G8AfAzAM3kWLiNxjvlPAHzKzJ4CADN7IucyZiHOcRuAXwtunwngsRzLlwkzuw/ALztssh7AF6zhfgB9JM9xXY6qBIB+AI823T8cPBa6jZmdAHAMwMtzKV124hx3sxvQOGuousjjDprE55rZzjwLlqE4n/WrAbya5G6S95O8OrfSZSfOcW8F8O7g+uO7APxZPkUrVNLffld0RTBPkHw3gEEAv1t0WbJGch6AfwRwfcFFydsCNLqBLkWjpXcfyVVmdrTQUmXvOgC3m9k/kLwEwBdJvs7MThVdsKqrSgtgCsC5TfeXBY+FbkNyARpNxSdzKV124hw3SF4B4EMA1pnZszmVLUtRx/1SAK8DcC/Jn6LRRzpa8YHgOJ/1YQCjZjZjZj8B8EM0AkKVxTnuGwDcBQBm9l0AL0JjvRyfxfrtp1WVAPAAgJUkV5BciMYg72jLNqMA3hPcfgeAcQtGUyos8rhJrgbwGTQqfx/6hIGI4zazY2a22MyWm9lyNMY+1pnZRDHFdSLOd3wEjbN/kFyMRpfQoTwLmYE4x/1zAJcDAMnXohEAjuRayvyNAvijIBvojQCOmdnjrndSiS4gMztB8kYAY2hkDdxmZvtJfhTAhJmNAvg8Gk3Dg2gMrlxbXIndiHnc2wC8BMCXgzHvn5vZusIK7UDM4/ZKzGMeA3AlyYcBnASwxcwq3cqNedw3Afgsyc1oDAhfX/WTO5JfQiOYLw7GNj4MoAcAzOzTaIx1XAPgIIDjAP44k3JU/H0UEZEuVaULSEREHFMAEBGpKQUAEZGaUgAQEakpBQARkZpSABARqSkFABGRmlIAEBGpqf8HLMJ/djWL8WAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fcddafaee50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Check that matplotlib is working.\n",
    "x = np.random.rand(100).astype(np.float32)\n",
    "noise = np.random.normal(scale=0.3, size=len(x))\n",
    "y = np.sin(x * 7) + noise\n",
    "pyplot.scatter(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/notebooks/amld/solutions\n",
      "0_intro.ipynb\t   3_tf_ml.ipynb\t README.md\n",
      "1_qd_data.ipynb    4_qd_estimator.ipynb  _derived\n",
      "2_tf_basics.ipynb  5_qd_cloud.ipynb\t _generate_exercises.ipynb\n"
     ]
    }
   ],
   "source": [
    "# You can run shell commands directly in Jupyter: simply prepend\n",
    "# the command with a \"!\".\n",
    "!pwd\n",
    "!ls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<function tensorflow.python.ops.array_ops.one_hot>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Auto-completion: Jupyter shows possible completions of partially typed\n",
    "# commands -- place the cursor below just \"one\" and type <TAB>\n",
    "### YOUR ACTION REQUIRED:\n",
    "# Complete below line.\n",
    "tf.one_hot #tf.one"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Welcome to the AMLD Tensorflow basics Workshop!'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def xor_str(a, b):\n",
    "    return ''.join([chr(ord(a[i % len(a)]) ^ ord(b[i % len(b)]))\n",
    "                    for i in range(max(len(a), len(b)))])\n",
    "\n",
    "### YOUR ACTION REQUIRED:\n",
    "# Try to find the \"correct value\" for below variable...\n",
    "workshop_secret = 'Tensorflow rocks' #workshop_secret = '(replace me!)'\n",
    "xor_str(workshop_secret, '\\x03\\x00\\x02\\x10\\x00\\x1f\\x03L\\x1b\\x18\\x00\\x06\\x07\\x06K2\\x19)*S;\\x17\\x08\\x1f\\x00\\x05F\\x1e\\x00\\x14K\\x115\\x16\\x07\\x10\\x1cR1\\x03\\x1d\\x1cS\\x1a\\x00\\x13J')\n",
    "\n",
    "# Hint: You might want to checkout the ../solutions directory\n",
    "# (you should already have opened this directory in a browser tab :-)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
